package com.bicon.botu.medical.common.enums;

/**
 * 食物餐类型
 *
 * @author 李双喜
 * @date 2018/7/19 9:38
 */

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonValue

enum class FoodMealEnum(@JsonValue val value: Int) {
    RECIPES_BREAKFAST(1),
    RECIPES_LUNCH(2),
    RECIPES_DINNER(3),
    RECIPES_ADDMEAL(4);

    companion object {
        @JsonCreator
        @JvmStatic
        fun enumOf(value: Int): FoodMealEnum {
            val found = FoodMealEnum.values().find { value == it.value }
            if (found != null) {
                return found
            } else {
                throw IllegalArgumentException("not found ConversationCategory with $value")
            }
        }
    }

}
